﻿using System;
using UnityEngine;

public class EventMouseScrollWheelEditor {
	// === Public =====================================================================================================
	public static void Action() {
		var scrollWheel = Input.GetAxis(InputConstants.MOUSE_SCROLL_WHEEL);
		if (!(Math.Abs(scrollWheel) > 0f)) {
			return;
		}
		var mainCamera = MapEditorBaseData.GetInstance.Camera.camera;
		if (mainCamera == null) {
			return;
		}
		mainCamera.orthographicSize = scrollWheel > 0f ?
			Mathf.Min(mainCamera.orthographicSize + 1, EditorConstants.MAX_ORTHOGRAPHIC_SIZE) :
			Mathf.Max(mainCamera.orthographicSize - 1, EditorConstants.MIN_ORTHOGRAPHIC_SIZE);
	}
}